package com.youxin.infra.util;

public class ConstantsUtil {
    public static final String KAFKA_SQL_EVEN_CREATE = "CREATE TABLE even (\n" +
            "  `id` INTEGER,\n" +
            "  `name` STRING,\n" +
            "  `counts` INTEGER,\n" +
            "  `ts` TIMESTAMP(3)," +
            " WATERMARK FOR ts as ts - INTERVAL '5' SECOND \n" +
            ") WITH (\n" +
            "  'connector' = 'kafka',\n" +
            "  'topic' = 'flink_sql_table_test_datas',\n" +
            "  'properties.bootstrap.servers' = '172.16.2.148:9092',\n" +
            "  'properties.group.id' = 'testGroup',\n" +
            "  'scan.startup.mode' = 'earliest-offset',\n" +
            "  'format' = 'json'\n" +
            ")";

    public static final String KAFKA_SQL_ODD_CREATE = "CREATE TABLE odd (\n" +
            "  `id` INTEGER,\n" +
            "  `name` STRING,\n" +
            "  `counts` INTEGER,\n" +
            "  `ts` TIMESTAMP(3)," +
            " WATERMARK FOR ts as ts - INTERVAL '5' SECOND \n" +
            ") WITH (\n" +
            "  'connector' = 'kafka',\n" +
            "  'topic' = 'flink_sql_table_test_datas',\n" +
            "  'properties.bootstrap.servers' = '172.16.2.148:9092',\n" +
            "  'properties.group.id' = 'testGroup',\n" +
            "  'scan.startup.mode' = 'earliest-offset',\n" +
            "  'format' = 'json'\n" +
            ")";


    public static final String KAFKA_SQL_SINK = "CREATE TABLE odd (\n" +
            "  `id` INTEGER,\n" +
            "  `name` STRING,\n" +
            "  `counts` INTEGER,\n" +
            "  `ts` TIMESTAMP(3)," +
            " WATERMARK FOR ts as ts - INTERVAL '5' SECOND \n" +
            ") WITH (\n" +
            "  'connector' = 'kafka',\n" +
            "  'topic' = 'flink_sql_table_test_datas',\n" +
            "  'properties.bootstrap.servers' = '172.16.2.148:9092',\n" +
            "  'properties.group.id' = 'testGroup',\n" +
            "  'scan.startup.mode' = 'earliest-offset',\n" +
            "  'format' = 'json'\n" +
            ")";

    public static final String QUERY_EVEN_AGG_SQL =
            "SELECT\n"
                    + "  id as even_id,name as even_name,\n"
                    + "  COUNT(counts) even_cnt \n"
                    + "FROM even \n"
                    + "GROUP BY TUMBLE(ts, INTERVAL '20' SECOND),id,name";

    public static final String QUERY_ODD_AGG_SQL =
            "SELECT\n"
                    + "  name as odd_name,ts,\n"
                    + "  COUNT(counts) odd_cnt \n"
                    + "FROM odd \n"
                    + "GROUP BY TUMBLE(ts, INTERVAL '20' SECOND),name,ts";
}
